home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / RIncludes / ConditionalMacros.r < prev    next >
Encoding:
Text File  |  1998-02-12  |  7.6 KB  |  194 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.r
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.1
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18.  
  19. #ifndef __CONDITIONALMACROS_R__
  20. #define __CONDITIONALMACROS_R__
  21.  
  22. /****************************************************************************************************
  23.     UNIVERSAL_INTERFACES_VERSION
  24.     
  25.         0x0310 => version 3.1
  26.         0x0301 => version 3.0.1
  27.         0x0300 => version 3.0
  28.         0x0210 => version 2.1
  29.         This conditional did not exist prior to version 2.1
  30. ****************************************************************************************************/
  31. #define UNIVERSAL_INTERFACES_VERSION 0x0310
  32.  
  33. /****************************************************************************************************
  34.  
  35.     TARGET_CPU_≈    
  36.     These conditionals specify which microprocessor instruction set is being
  37.     generated.  At most one of these is true, the rest are false.
  38.  
  39.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  40.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  41.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  42.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  43.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  44.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  45.  
  46.  
  47.     TARGET_OS_≈    
  48.     These conditionals specify in which Operating System the generated code will
  49.     run. At most one of the these is true, the rest are false.
  50.  
  51.         TARGET_OS_MAC            - Generate code will run under Mac OS
  52.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  53.         TARGET_OS_UNIX            - Generate code will run under some unix 
  54.  
  55.  
  56.     TARGET_RT_≈    
  57.     These conditionals specify in which runtime the generated code will
  58.     run. This is needed when the OS and CPU support more than one runtime
  59.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  60.  
  61.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  62.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  63.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  64.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  65.  
  66.  
  67.     PRAGMA_≈
  68.     These conditionals specify whether the compiler supports particular #pragma's
  69.     
  70.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  71.         PRAGMA_ONCE              - Compiler supports: #pragma once
  72.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  73.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  74.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  75.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  76.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  77.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  78.  
  79.     FOUR_CHAR_CODE
  80.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  81.     is compiled down to the correct value on all compilers.
  82.  
  83.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  84.  
  85.     TYPE_≈
  86.     These conditionals specify whether the compiler supports particular types.
  87.  
  88.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  89.         TYPE_BOOL                - Compiler supports "bool"
  90.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  91.  
  92. ****************************************************************************************************/
  93.  
  94.  
  95.  
  96. /*
  97.     Rez resource compiler from Apple Computer, Inc.    
  98. */
  99. #define TARGET_CPU_PPC              0
  100. #define TARGET_CPU_68K              0
  101. #define TARGET_CPU_X86              0
  102. #define TARGET_CPU_MIPS             0
  103. #define TARGET_CPU_SPARC             0
  104. #define TARGET_OS_MAC                1
  105. #define TARGET_OS_WIN32                0
  106. #define TARGET_OS_UNIX                0
  107. #define TARGET_RT_LITTLE_ENDIAN        0
  108. #define TARGET_RT_BIG_ENDIAN        1
  109. #define TARGET_RT_MAC_CFM            0
  110. #define TARGET_RT_MAC_68881            0
  111. #define PRAGMA_ONCE                    0
  112.  
  113.  
  114.  
  115. /****************************************************************************************************
  116.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  117.  
  118.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  119.     GENERATING68K            - Compiler is generating 68k family instructions
  120.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  121.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  122.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  123.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  124.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  125.  
  126. ****************************************************************************************************/
  127. #if TARGET_OS_MAC
  128. #define GENERATINGPOWERPC TARGET_CPU_PPC
  129. #define GENERATING68K TARGET_CPU_68K
  130. #define GENERATING68881 TARGET_RT_MAC_68881
  131. #define GENERATINGCFM TARGET_RT_MAC_CFM
  132. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  133. /*
  134.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  135.           interface files for System 7 and Copland.  Now that Copland
  136.           is canceled, all FOR_ conditionals have been removed from
  137.           the interface files.  But, just in case you someone got an 
  138.           interface file that uses them, the following sets the FOR_≈
  139.           conditionals to a consistent, usable state.
  140.  
  141.     #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  142.     #ifndef FOR_PTR_BASED_AE
  143.         #define FOR_PTR_BASED_AE                    0
  144.     #endif
  145.     #define FOR_SYSTEM7_ONLY                        1
  146.     #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  147.     #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  148.     #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  149.     #define FOR_SYSTEM8_COOPERATIVE                    0
  150.     #define FOR_SYSTEM8_PREEMPTIVE                    0
  151. */
  152. #endif
  153.  
  154.  
  155.  
  156. /****************************************************************************************************
  157.  
  158.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  159.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  160.                               are now more sensitive to change because CFM binds by name.  In the 
  161.                               past, system routine names were compiled out to just an A-Trap.  
  162.                               Macros have been added that each map an old name to its new name.  
  163.                               This allows old routine names to be used in existing source files,
  164.                               but the macros only work if OLDROUTINENAMES is true.  This support
  165.                               will be removed in the near future.  Thus, all source code should 
  166.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  167.                               to see if your code has any old names left in it.
  168.     
  169.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  170.                               has been moved from Strings to TextUtils.  It is conditionalized in
  171.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  172.                               This allows developers to upgrade to newer interface files without 
  173.                               having to change the includes in their source code.  But, it allows
  174.                               the slow migration of system calls to more understandable file locations.  
  175.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  176.                               default to false.
  177.  
  178. ****************************************************************************************************/
  179. #ifndef OLDROUTINENAMES
  180. #define OLDROUTINENAMES 0
  181. #endif
  182. #ifndef OLDROUTINELOCATIONS
  183. #define OLDROUTINELOCATIONS 0
  184. #endif
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. #endif /* __CONDITIONALMACROS_R__ */
  193.  
  194.